﻿using System;
using DG.Tweening;
using UnityEngine;
using UnityEngine.UI;

namespace Gp.Scripts.GUI {
    [RequireComponent(typeof(Image))]
    public class PsionicsAreaIcon : MonoBehaviour {
        private Image _icon;
        private const float FadeDuration = 0.2f;
        private Color _org;
        [SerializeField]
        private Color right = Color.red;
        
        [SerializeField]
        private Color left = new(1f, 1f, 0.8f);
        
        private void Awake() {
            _icon = GetComponent<Image>();
            _org = _icon.color;
        }


        public void MarkAsLeft() {
            this._icon.DOColor(left, FadeDuration);
        }


        public void MarkAsNormal() {
            this._icon.DOColor(_org, FadeDuration);
        }


        public void MarkAsRight() {
            _icon.DOColor(right, FadeDuration);   
        }
    }
}